IEEE 1588 Precision Time Protocol (PTP) [1][2] is the industry accepted protocol for transferring time information over packet networks. PTP is designed as an improvement to the current version of the Network Time Protocol (NTP) [3]. There are a number of works cited in the literature that describe clock synchronization using the Kalman filter technique. Many of these works [16-27] are mostly academic and do not show how the clock synchronization (correction) is implemented and how the slave clock behaves.
Basic Definitions                Clock Offset: The clock offset at a particular moment is the difference between the time reported by the time client (slave) and the “true” time as reported by the time server (master).        Clock Skew: A clock's skew at a particular moment is the frequency difference (first derivative of its offset with respect to true time) between the client clock and the server clock.        
Clock synchronization has received considerable attention over the last several years as the communication networks evolve from circuit-switched to all-IP packet based networks. With this migration the challenge of frequency and time synchronization has surfaced. The techniques in the state of the art differ by the assumed model and the estimated parameters.
The first group assumes that the two clocks differ by an offset. As a result the algorithms and techniques attempt to estimate only the offset between the clocks. The reality is far from this model, however, and as a result the second group adopts a more realistic model where the clocks differ by an offset and a skew. The skew is assumed constant in the duration of the estimation process. In order to achieve robust and accurate synchronization, advanced algorithms are needed that estimate the offset and skew simultaneously.
Clock synchronization over packet networks (LANs) but with the offset only assumption has been proposed in [4] and [5]. The former implements offset estimation using IEEE 1588 protocol which is more accurate than the latter that uses the Network Time Protocol (NTP) which is software-based, inaccurate time-stamping method.
The importance of clock synchronization in telecommunication networks has been highlighted in [6] where a phase control loop has been proposed using the IEEE 1588 PTP protocol to estimate the offset. Another recent offset-only clock synchronization algorithm has been proposed in [7] which follows [6] in concept where the PTP algorithm is used as the time-stamp exchange mechanism and a PLL is implemented to estimate the offset. In addition the authors propose noise reduction mechanisms to deal with Packet Delay Variation (PDV) noise typically experienced in packet networks.
The problem with all these techniques is the non-realistic assumption that the two clocks differ only by an offset. The reality however is that the slave clock, in addition to the offset, deviates in time as well due the skew problem which is an inherent problem with most clocks. As a result, in order to enable robust and accurate synchronization, both the offset and the skew should be estimated.
There are several techniques that propose clock synchronization algorithms to estimate the skew through linear regression or linear programming techniques and convex hull methods.
Specifically, [8] proposes a median line-fitting technique which is a robust line-fitting technique. The problem with line-regression algorithms is that they are usually not robust to presence of large outliers and thus the robustness is only valid for certain PDV models (e.g. Gaussian).
In [9] a simple skew and offset estimation method is proposed where timestamps are used to compute the average jitter and average inter-packet arrival time. Then the relative skew is computed as the ratio of the average jitter to the average inter-packet time.
A more complicated approach is proposed in [10] [11] where a linear programming technique is used to estimate the clock skew in network delay measurements. The technique shows improvement in performance compared to other existing algorithms.
In [12], [13] skew estimation is achieved through the computation of convex hull from the delay measurements. The authors claim that convex-hull approach provides better insight and handling of error metrics compared to linear regression or linear programming techniques. Although the technique was tested using NTP, it can be implemented with any protocol (such as IEEE 1588) that captures the delay measurements.
An extension of this technique is introduced by [14] where both the offsets and skew are estimated by a lower and upper convex hull approach that relies on using forward/backward delay measurements.
An adaptive approach to estimating the clock skew was proposed in [15] where a recursive least squares approach is used to calculate an estimate of the clock skew.
One major drawback of these techniques is that they have been developed using NTP messaging mechanisms which does not have high accuracy. For very precise clock synchronization applications such as synchronizing TDD base stations over packet network a more robust approach is required that integrates IEEE 1588 protocol.
All these techniques follow a “batch” approach to skew and/or offset estimation and as such can be computationally expensive. An alternative approach to skew and offset estimation can be achieved by observing the recursive nature of time-stamping and delay measurements which provide an opportunity for implementing recursive optimal filters such as the Kalman filter.
The implementation of Kalman Filter for clock synchronization using NTP was proposed in [16] and compared to existing techniques such as linear programming and statistical averaging.
In [17], estimating the frequency deviation in clocks to synchronize radio base stations in packet based network using time-tamping and Kalman filtering approach is proposed. The method estimates the frequency error (skew) and the frequency drift over time and does not estimate the time offset which is very important for accurate synchronization.
A heuristic approach to time synchronization over NTP packet networks using Kalman Filter was proposed and evaluated [18].
A Kalman Filter skew only clock synchronization using IEEE 1588 over wireless links was proposed in [19] which has limitations due to ignoring the offset component.
A circuit design for implementing clock synchronization using a Kalman filter approach is proposed in [20].
A technique to estimate the clock/time deviations based on the implementation of a Kalman filter on a smooth sequence of measured beacon intervals was proposed in [21]. The technique is mainly implemented for rovers in motion and as a result the state equations for the Kalman filter involve components that model the dynamicity. In addition the technique proposes to estimate pseudo ranges or distances at the same time which can be used to localize the rovers.
An Interactive Multi-Modal (IMM) Kalman filter clock synchronization technique was proposed in [22] where the time-varying clock state vector was estimated for different environments for wireless sensor networks.
Clock synchronization (skew and offset) using a Kalman filter has been proposed for wireless sensor networks (WSN) where nodes synchronize to a master node (master clock) through packet transmission across the network [23].
Detailed performance analysis of Kalman-Filter based clock synchronization using IEEE 1588 protocol was presented in [24] where both the skew and offset were modeled and estimated.
An algorithm to track clock offset and skew using a Kalman Filter in networks that lack high-accuracy oscillators or programmable network interfaces was proposed in [25]. High synchronization accuracy was demonstrated through extensive simulations and real clock oscillator measurements.
IEEE 1588 Precision Timing Protocol (PTP)
IEEE 1588 PTP was defined [1][2] to synchronize distributed clocks across Ethernet and other packet based networks. It allows for synchronization of distributed clocks to sub-microsecond accuracy. IEEE 1588 PTP was designed as an improvement to current time synchronization technologies such as the Network Time Protocol (NTP) [3]. NTP allows for synchronization of distributed clocks to a precision in the order of hundreds of microseconds or milliseconds, which for many applications such as personal computer use is a sufficient level of accuracy. IEEE 1588 PTP, which is now the industry accepted standard for synchronization, grew out of the need for greater accuracy synchronization over packet networks, particularly Ethernet.
IEEE 1588 PTP relies on the use of hardware timestamped messages to synchronize one or more slave clocks (time client) to a master clock (time server). This process involves a message transaction between the master and slave where the precise moments of transmit and receive are measured, preferably at the hardware level. Accurate time information is distributed hierarchically, with a grandmaster clock at the root of the hierarchy. The grandmaster provides the time reference for one or more slave devices. These slave devices can, in turn, act as master devices for further hierarchical layers of slave devices.
IEEE 1588 PTP also defines the descriptors that characterize a clock, the states of a clock and the allowed state transitions. The standard defines network messages, fields and semantics, the datasets maintained by each clock and the actions and timing for all IEEE 1588 network and internal events. In addition, the standard describes a suite of messages used for monitoring the system, specifications for an Ethernet-based implementation and conformance requirements and some implementation suggestions.
IEEE 1588 PTP relies on the transfer of PTP messages to determine clock and system properties and to convey time information. A delay measurement process is used to determine path delays, which are then accounted for in the adjustment of local clocks. At system start up, a master/slave hierarchy is created using the Best Master Clock (BMC) algorithm [1] to determine which clock has the highest quality clock (grandmaster clock) within the network. The BMC algorithm is then run continuously to allow clocks to adjust quickly to changes in network configuration and status. If the grandmaster clock is removed from the network or is determined by the BMC algorithm to no longer be the highest quality clock, the algorithm then redefines what the new grandmaster clock is and all other clocks are adjusted accordingly.
Synchronization with IEEE 1588 PTP is achieved using a series of message transactions between a master and its slaves. FIG. 1 shows the message flow process for a strictly peer-to-peer message transaction scenario. This figure illustrates the case where the master clock in a time server 10 is directly attached (or peered) to a slave clock in a time client 14 over a packet network 12. The slave clock derives its timing from the upstream master clock and then acts as a master clock for further downstream devices. The main time synchronization related message types for this exchange involve the Sync, Follow_Up, Delay-Req, and Delay_Resp messages. Other more complex message flow process where message traverse intermediate nodes are described in the IEEE 1588 PTP standard.
In FIG. 1, the master sends a Sync message to the slave and notes the time, T1, at which it was sent. The slave receives the Sync message and notes the time of reception, T2. The master conveys to the slave the timestamp T1 by either embedding the timestamp T1 in the Sync message (i.e., one-step clock mode which requires some sort of hardware processing for embedding the timestamp on-the-fly for highest accuracy and precision), or embedding the timestamp T1 in a Follow_Up message (i.e., two-step clock mode). The slave sends a Delay_Req message to the master and notes the time, T3 at which it was sent. The master receives the Delay_Req message and notes the time of reception, T4. The master conveys to the slave the timestamp T4 by embedding it in a Delay_Resp message. The use of Follow_Up messages eliminates the need to timestamp transmitted messages on the fly, thereby facilitating a simpler hardware implementation.
After this message exchange the slave will have four timestamps {T1, T2, T3, T4} from which it can determined both the network delay, d (the time taken for messages to traverse the network link between the two nodes) and the slave offset, θ, (time offset by which the slave clock leads or lags the master). Messages containing current time information are adjusted to account for their path delay, therefore providing a more accurate representation of the time information conveyed.T2=T1+θ+d  (1)T3=T4+θ−d  (2)
Under the assumption that the delays for the two paths are symmetric (the delay in one direction is the same as the delay in the opposite direction), the following relationships can be derived (see FIG. 1):
                              d          ^                =                                            (                                                T                  2                                -                                  T                  1                                            )                        +                          (                                                T                  4                                -                                  T                  3                                            )                                2                                    (        3        )                                θ        =                                            (                                                T                  2                                -                                  T                  1                                            )                        -                          (                                                T                  4                                -                                  T                  3                                            )                                2                                    (        4        )            
The clock offset θ can be used to align the local clock to the master's. A key assumption here is that the message exchanges occur over a period of time so small that the offset θ can be assumed constant over that period. In addition, the accuracy of this link delay measurement depends on both the symmetry of the one-way link delays and the accuracy of the timestamping process. A master clock device synchronizes the attached slave clock devices through the use of periodic Sync and Follow_Up messages. The slave clock devices use the information captured in these messages to perform periodic adjustments to their local clock.
A complete IEEE 1588-based solution at a time client 14 includes servo algorithms, filters, a PTP-Clock based on hardware timer and direct timer access. IEEE 1588 defines a wide range of synchronization capabilities except the clock synchronization mechanisms (servo algorithm, PLL, timers, etc.) to be used at the receiver (slave) to synchronize its local clock to the master. Methods of clock adjustment implementation are not specified by IEEE 1588; it only provides a standard protocol for the exchange of messages between clocks. The benefit of not specifying clock adjustment implementations, is to allow clocks from different manufactures to be able to synchronize with each other as long as they understand the messaging protocol.
There are a number of factors that can cause two supposedly identical clocks to drift apart or lose synchronization. Differences in temperature, the age of the oscillators themselves, manufacturing defects and material variations in the manufacturing process, and electric and magnetic interference, among other factors, can all affect the quality of synchronization.
Even the smallest errors in keeping time can significantly add up over a long period. If a clock frequency (skew) is off by just 10 parts per million (ppm), it will gain or lose almost a second a day (i.e., 24×60×60/105=0.86 s/day). All of these factors create a need for clock synchronization to allow for two clocks to be aligned when differences occur. The continuous variations of the above factors also explain why the process of synchronization is a continuous and not a one-time process. Clearly, having any sort of meaningful time synchronization is almost impossible if clocks are allowed to run on their own without synchronization.
The above simple analysis shows that clock skew is the main reason why clocks drift apart and need to be aligned periodically. The analysis earlier on based on FIG. 1 assumes no clock system. Adjusting the clock skew in addition to the initial clock offset guarantees the long term reliability of the synchronization process. Critical applications like those enumerated above require higher synchronization accuracy and reliability.
An object of the present invention is to achieve accurate and robust synchronization, preferably over IEEE 1588, for critical applications that require stringent synchronization margins.